Repository navigation
export: mint erwin-native ids ({UPPERCASE-GUID}+00000000) so real erwin imports - #64
Merged
Merged
Conversation
…in imports
erwin's import engine (EAT) hangs on a Modelith-minted object id: it was a lowercase SHA-1
brace GUID with no serial, e.g. {1754afad-...}. Real erwin (10.10) writes ids as an UPPERCASE
brace GUID with a +8hex serial, e.g. {0007EEEF-A625-4777-B5CB-6BCF63932FF4}+00000000, and
validates that shape on import. A scoped-export file of a real mart had 382/505 ids malformed
(the model root, every new entity + its attributes, every relationship, the subject area, and
71 *_Ref elements) and the import hung at 'EAT is importing'; the 123 ids that loaded were the
old erwin-origin objects keeping their preserved erwin_id.
Fix _guid() to emit {UPPERCASE-GUID}+00000000. Every minted id and every <..._Ref> flows from
the same id maps, so one change fixes ids and refs consistently; a preserved erwin_id is still
emitted verbatim. Output stays XSD-valid and still round-trips through our own importer (it is
case-insensitive on id joins). Tests assert the uppercase+serial shape and fail on any lowercase
or suffix-less brace GUID. A Modelith-native model's export ids are a pure function of the model
on disk, so re-exporting an existing model picks up the fix with no migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Importing a Modelith-exported erwin XML into real erwin Data Modeler (10.10) hangs at "EAT is importing" and never loads. Root cause: the object ids Modelith mints for its own (non-erwin-origin) objects are the wrong shape.
+8hexserial, e.g.{0007EEEF-A625-4777-B5CB-6BCF63932FF4}+00000000. Its import engine (EAT) validates this shape._guid()was emitting a lowercase SHA-1 brace GUID with no serial, e.g.{1754afad-b7e9-5df5-bfc7-2e763e0683d8}.In a scoped-export file of a real GHG mart, 382 of 505 ids were malformed — the model root, all new entities + their attributes, every relationship, the subject area, and 71
*_Refelements pointing at them. The 123 ids that would have loaded were the old erwin-origin objects keeping their preservederwin_id.(Both the format and the root cause were confirmed by inspecting a real erwin export and the exporter source.)
The fix
_guid()now emits{UPPERCASE-GUID}+00000000. Every minted id and every<..._Ref>flows from the same id maps, so one change fixes ids and refs consistently. A preservederwin_id(a real erwin object, which already has this shape) is emitted verbatim — the normalisation only ever touches ids we mint.Tests
3 new guards (in addition to the existing 16): the minted model-root id is
{UPPERCASE}+00000000; a fully-native model emits no lowercase and no suffix-less brace GUID; a preservederwin_idis emitted unchanged. 612 passed, ruff clean.Not the cause (noted, not fixed here)
Date/Boolean attributes export as
Logical_Data_Type VARCHARbecause those domains aren't defined in the XML — loses typing but does not block the import. Separate quality fix.Caveat
Real erwin can't be driven in CI here. The fix is built to the
{UPPERCASE-GUID}+00000000format observed in a real erwin 10.10 export and is XSD-valid + round-trips; the actual EAT import is confirmable on the Windows box with the GHG mart.